//
//  DCDriverManagerViewController.m
//  Driver
//
//  Created by 大橙子 on 2018/11/8.
//  Copyright © 2018 Tomous. All rights reserved.
//

#import "DCDriverManagerViewController.h"
#import "DCDrivierTaskViewController.h"
#import "DCDriverEmptyViewController.h"
#import "DCDriverBlackListViewController.h"
#import "DCNewDriverViewController.h"
@interface DCDriverManagerViewController ()
@property (nonatomic, strong) ZWMSegmentController *segmentVC;
@end

@implementation DCDriverManagerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithImage:IMAGENAME(@"加号 (2)") style:UIBarButtonItemStylePlain target:self action:@selector(rightBarDidClick)];
    self.navigationItem.rightBarButtonItem = rightItem;
    
    [self setUpViewControllers];
}
-(void)setUpViewControllers{
    DCDrivierTaskViewController *sendOrderVC = [[DCDrivierTaskViewController alloc] init];
    DCDriverEmptyViewController *quotationVC = [[DCDriverEmptyViewController alloc] init];
    DCDriverBlackListViewController *robVC = [[DCDriverBlackListViewController alloc] init];
    
    NSArray *array = @[sendOrderVC,quotationVC,robVC];
    
    self.segmentVC = [ZWMSegmentController segmentControllerWithFrame:self.view.bounds Titles:@[@"任务中",@"空闲",@"黑名单"] type:1];
    self.segmentVC.segmentView.showSeparateLine = YES;
    self.segmentVC.segmentView.segmentTintColor = BlueColor;
    self.segmentVC.viewControllers = [array copy];
    if (array.count==1) {
        self.segmentVC.segmentView.style=ZWMSegmentStyleDefault;
    } else {
        self.segmentVC.segmentView.style=ZWMSegmentStyleFlush;
    }
    [self.segmentVC  enumerateBadges:@[@10,@21,@13]];
    [self addSegmentController:self.segmentVC];
    [self.segmentVC  setSelectedAtIndex:0];
}
-(void)rightBarDidClick {
    DCNewDriverViewController *newCar = [[DCNewDriverViewController alloc]init];
    [self.navigationController pushViewController:newCar animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
